﻿using System;

namespace CSharp_1209
{
    class Student
    {
        private string idStudent;

        // PROPERTY
        public string IdStudent
        {
            get
            {
                return idStudent;
            }
            set
            {
                if (value.Length > 3)
                    idStudent = value;
            }
        }

        public static void Test()
        {
            // Declaring integer constant to store value 100
            // Java dùng final
            const int percentConst = 100;

            //Declaring variable to store the student name
            string studentName;

            //Declaring variables to store the student marks
            int english, maths, science;

            //Declaring and initialising variable to store the percentage
            float percent = 0.0f;


            //Accepting the details of the student
            // System.out.println()
            Console.Write("Enter name of the student : ");
            studentName = Console.ReadLine();

            Console.Write("Enter marks for english : ");
            english = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter marks for maths : ");
            maths = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter marks for science : ");
            science = Convert.ToInt32(Console.ReadLine());

            //Calculating the percentage of the student
            percent = ((english + maths + science) * percentConst) / 300;

            //Displaying the details of the student
            Console.WriteLine("Student Name : " + studentName);

            Console.WriteLine("Marks obtained in English : {0}", english);
            Console.WriteLine("Marks obtained in Maths : {0}", maths);
            Console.WriteLine("Marks obtained in Science : {0}", science);

            Console.WriteLine("Percent : {0:F2}", percent);

            Student s = new Student();
            s.IdStudent = "def";
            string ss = s.IdStudent + "abc";
        }
    }
}
